home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
TURB_VIS
/
ALEXLEVI
/
DEMO
/
DEMO_KBD.C
< prev
next >
Wrap
Text File
|
1994-04-03
|
3KB
|
67 lines
/*
****************************************************************************
* *
* This function was made by Alex Levitas' "Keyboard Map Editor". *
* *
****************************************************************************
This function convert single character from standard keyboard map to new.
May be used after reading single character from keyboard. Use
ConvertChar(getch()) call instead of getch() call.
To use this function in your program, insert the directive
#include "DEMO_KBD.C"
If you want to use more than one keyboard map in your program, you
must change function name in each source file.
*/
char ConvertChar(char PressedChar)
{
static char PreviousChar = 0xFF;
char KeyboardChars[92] = {126, 96, 33, 49, 64, 50, 35, 51, 36, 52,
37, 53, 94, 54, 38, 55, 42, 56, 40, 57,
41, 48, 95, 45, 43, 61, 81,113, 87,119,
69,101, 82,114, 84,116, 89,121, 85,117,
73,105, 79,111, 80,112,123, 91,125, 93,
65, 97, 83,115, 68,100, 70,102, 71,103,
72,104, 74,106, 75,107, 76,108, 58, 59,
34, 39, 90,122, 88,120, 67, 99, 86,118,
66, 98, 78,110, 77,109, 60, 44, 62, 46,
63, 47};
char Convert_Chars[92] = {126, 96, 33, 49, 34, 50, 58, 51, 47, 52,
37, 53, 44, 54, 46, 55, 63, 56, 40, 57,
41, 48, 95, 45, 43, 61,137,169,150,230,
147,227,138,170,133,165,141,173,131,163,
152,232,153,233,135,167,149,229,154,234,
148,228,155,235,130,162,128,160,143,175,
144,224,142,174,139,171,132,164,134,166,
157,237,159,239,151,231,145,225,140,172,
136,168,146,226,156,236,129,161,158,238,
240,241};
int I;
if (!PreviousChar)
{
PreviousChar = PressedChar;
return(PressedChar);
};
PreviousChar = PressedChar;
for (I = 0; (I < 92) && (PressedChar != KeyboardChars[I]); I++);
if (I == 92) return (PressedChar);
if (!Convert_Chars[I]) return (PressedChar);
return (Convert_Chars[I]);
}